package com.zhku.shoppingspringboot.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.sun.org.apache.xpath.internal.operations.Bool;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.io.Serializable;

/**
 * @author hwy
 * @date 2025-01-01 15:57
 */

@Entity
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("goods")
@ApiModel(value="goods对象", description="商品表")
public class Goods implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 商品id
     */
    @Id
    @Column(name = "id")
    @ApiModelProperty("商品id")
    private Long id;

    /**
     * 品牌id
     */
    @ApiModelProperty("品牌id")
    @TableField("brandId")
    @Basic
    @Column(name = "brandId")
    private String brandId;
    /**
     * 商品所属分类, 多级以数组形式体现，如[一级分类，二级分类，三级分类]
     */
    @Basic
    @Column(name = "categories")
    @ApiModelProperty("商品所属分类")
    private String categories;
    /**
     * 商品收藏总数
     */
    @TableField("collectCount")
    @ApiModelProperty("商品收藏总数")
    @Basic
    @Column(name = "collectCount")
    private Integer collectCount;
    /**
     * 商品评论总数
     */
    @TableField("commentCount")
    @ApiModelProperty("商品评论总数")
    @Basic
    @Column(name = "commentCount")
    private Integer commentCount;
    /**
     * 商品描述
     */
    @TableField("`desc`") // 使用反引号包裹保留字
    @ApiModelProperty("商品描述")
    @Basic
    @Column(name = "desc")
    private String desc;
    /**
     * 商品折扣
     */
    @ApiModelProperty("商品折扣")
    @Basic
    @Column(name = "discount")
    private Float discount;

    /**
     * 商品库存数
     */
    @ApiModelProperty("商品库存数")
    @Basic
    @Column(name = "inventory")
    private Integer inventory;
    /**
     * 商品是否为预售商品
     */
    @ApiModelProperty("商品是否为预售商品")
    @TableField("isPreSale")
    @Basic
    @Column(name = "isPreSale")
    private Boolean isPreSale;
    /**
     * 商品主图集合
     */
    @TableField("mainPictures")
    @ApiModelProperty("商品主图集合")
    @Basic
    @Column(name = "mainPictures")
    private String mainPictures;
    /**
     * 商品主图视频合集
     */
    @ApiModelProperty("商品主图视频合集")
    @TableField("mainVideos")
    @Basic
    @Column(name = "mainVideos")
    private String mainVideos;
    /**
     * 商品名字
     */
    @ApiModelProperty("商品名字")
    @Basic
    @Column(name = "name")
    private String name;
    /**
     * 商品原价
     */
    @ApiModelProperty("商品原价")
    @TableField("oldPrice")
    @Basic
    @Column(name = "oldPrice")
    private Float oldPrice;
    /**
     * 商品价格
     */
    @ApiModelProperty("商品价格")
    @Basic
    @Column(name = "price")
    private Float price;
    /**
     * 商品推荐集合, 仅APP有此数据
     */
    @ApiModelProperty("商品推荐集合")
    @Basic
    @Column(name = "recommends")
    private String recommends;
    /**
     * 商品销量
     */
    @ApiModelProperty("商品销量")
    @TableField("salesCount")
    @Basic
    @Column(name = "salesCount")
    private Integer salesCount;

    /**
     * 商品spu编码
     */
    @ApiModelProperty("商品spu编码")
    @TableField("spuCode")
    @Basic
    @Column(name = "spuCode")
    private String spuCode;
    /**
     * 商品主图视频比例, 视频比例,1为1:1/16:9，2为3:4
     */
    @ApiModelProperty("商品主图视频比例")
    @TableField("videoScale")
    @Basic
    @Column(name = "videoScale")
    private Integer videoScale;

}
